class UserTypesController < ApplicationController
  layout "main"
  before_filter :pre_session
  active_scaffold :user_type do |config|
    config.label = '<br/>'
    config.list.per_page = 10
    config.columns = [:id, :name]
    config.columns[:name].label = "ประเภท"
    config.create.columns.exclude :id
    config.update.columns.exclude :id
    config.list.sorting = {:id => 'ASC'}
  end

  def pre_session
    if !isadmin?
      redirect_to :controller=>"main"
    end
  end
end
